/*
* @Author: wanghongfucoder
* @Date:   2017-03-29 11:05:55
* @Last Modified by:   wanghongfucoder
* @Last Modified time: 2017-03-29 11:09:25
*/

public class Computer implements ComputerPart {
	ComputerPart[] parts;
	public Computer(){
		parts=new ComputerPart[]{new Mouse(),new Keyboard(),new Monitor()};
	}

	public void accept(ComputerPartVisitor computerPartVisitor){
		for (ComputerPart part: parts ) {
			part.accept(computerPartVisitor);
		}
		computerPartVisitor.visit(this);
	}
}